package javacommon.base;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;


public class LoadConfig {

	/**
	 * @author chengchanglun
	 * @param args
	 */

	private Properties prop;

	/**
	 * @param path
	 *            as "/db.properties"
	 */
	public LoadConfig(String path) {

		prop = new Properties();

		InputStream in = null;

		try {

			in = getClass().getResourceAsStream(path);

			prop.load(in);

			in.close();

		} catch (IOException e) {

			e.printStackTrace();
		}

	}

	public String getDriverClass() {

		return prop.getProperty("driverClass");

	}

	public String getURL() {
		return prop.getProperty("url");

	}

	public String getUserName() {

		return prop.getProperty("username");
	}

	public String getPassWord() {

		return prop.getProperty("password");
	}

	public String getImServer() {
		return prop.getProperty("imserver");
	}

	public String getImSecret() {
		return prop.getProperty("imsecret");
	}
}